package org.suk.dp.flyweight;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Description: <br/>
 * @version V1.0  2017/6/22 15:41  by 石冬冬(dongdong.shi@ucarinc.com) - Heil Hitler
 */
public class WebsiteFactory {
    private Map<String,ConcreteWebsite> map = new ConcurrentHashMap<String, ConcreteWebsite>();

    public Website getWebsiteCategory(String key){
        if(!map.containsKey(key)){
            map.put(key,new ConcreteWebsite(key));
        }
        return map.get(key);
    }

    public int getWebsiteCount(){
        return map.size();
    }
}
